#!/bin/bash

set -e

CURRENT_DIR=$(pwd)
NAME=weberver

start_webserver()
{
    ./fcgiServer.sh start
    ./nginxd_with_ssl.sh start
}

shut_webserver()
{
    ./fcgiServer.sh stop
    ./nginxd_with_ssl.sh stop
}

status_webserver()
{
    ./fcgiServer.sh status
    ./nginxd_with_ssl.sh status
}


case "$1" in
  start)
    start_webserver
  ;;
  stop)
    shut_webserver
  ;;
  status)
    status_webserver
  ;;
  restart)
    shut_webserver
    start_webserver
  ;;
  *)
    echo "Usage: $NAME {start|stop|restart|status}" >&2
    exit 2
  ;;
esac
